package com.zyplayer.doc.data.repository.manage.mapper;

import com.zyplayer.doc.data.dto.WikiPageEsContentDTO;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageContent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zyplayer.doc.data.repository.manage.param.SearchByEsParam;
import com.zyplayer.doc.data.repository.manage.vo.SpaceNewsVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 暮光：城中城
 * @since 2019-02-24
 */
public interface WikiPageContentMapper extends BaseMapper<WikiPageContent> {
	
	List<SpaceNewsVo> getNewsList(SearchByEsParam param);

	@Select(value = "SELECT  A.id,A.name, B.page_id, B.content, B.create_user_id, B.create_user_name, B.create_time, B.update_user_id, B.update_user_name, B.update_time, B.preview\n" +
			"FROM  wiki_page A LEFT JOIN wiki_page_content B\n" +
			"on  B.page_id  = A.id where B.page_id = #{pageId}")
	WikiPageEsContentDTO getWikiPageContentByPageId(@Param("pageId") Long pageId);
}
